//
//  InterviewFinishVC.m
//  ATAInterview
//
//  Created by up72-17 on 2018/12/12.
//  Copyright © 2018 up72-17. All rights reserved.
//

#import "InterviewFinishVC.h"

@interface InterviewFinishVC ()

@end

@implementation InterviewFinishVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (void)exitApplication {
    
    AppDelegate *app = [UIApplication sharedApplication].delegate;
    UIWindow *window = app.window;
    // 动画 1
    [UIView animateWithDuration:0.5 animations:^{
        window.alpha = 0;
        window.frame = CGRectMake(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2, 0, 0);
    } completion:^(BOOL finished) {
        exit(0);
    }];
    //exit(0);
    
}


- (IBAction)buttonAction:(UIButton *)sender {
    if ([sender tag] == 0) {//退出
        [self exitApplication];
    } else if ([sender tag] == 2) {//回首页
        NSArray *temp = self.navigationController.viewControllers;
        for (NSInteger i = 0; i < [temp count]; i++) {
            id tempvc = [temp objectAtIndex:i];
            if ([tempvc isKindOfClass:[MainVC class]]) {
                [self.navigationController popToViewController:tempvc animated:YES];
                return;
            }
        }
    }
    
}



/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
